package com.activity;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

import com.example.apple.ddhr_new.R;
import com.example.apple.ddhr_new.utils.ToastUtil;
import com.example.lzbase.BaseActivity;

import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.example.apple.ddhr_new.activity.setting.WebViewActivity.INTENT_TITLE;
import static com.example.apple.ddhr_new.activity.setting.WebViewActivity.INTENT_URL;

public class ExportActivity extends BaseActivity {


    @BindView(R.id.tv_content)
    TextView tvContent;
    private String mH5Url;

    @Override
    protected int titleText() {
        return R.string.kaoqin_baobiao_daochu;
    }

    @Override
    protected void created(@Nullable Bundle savedInstanceState) {
         mH5Url = getIntent().getExtras().getString(INTENT_URL);
        mH5Url = mH5Url.replace("checkinreport", "checkinreportout");
        tvContent.setText(mH5Url);
        String title = getIntent().getExtras().getString(INTENT_TITLE);
        setTitleText(title+"导出");

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_export;
    }



    @OnClick(R.id.btn_denglu)
    public void onViewClicked() {
        ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
        // 创建普通字符型ClipData
        ClipData mClipData = ClipData.newPlainText("Label", mH5Url);
        // 将ClipData内容放到系统剪贴板里。
        cm.setPrimaryClip(mClipData);

        ToastUtil.toast(this,"已复制剪贴板");

    }
}
